﻿Public Class insertRoom
    Inherits System.Web.UI.Page

    Dim detail2 As New HotelLibrary.HotelDetail_t
    Dim hotelPxy As New edu.temple.cis_iis2.HotelService
    Dim ds As New DataSet

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            ds = hotelPxy.getHotel
            ddlHotel.DataSource = ds
        End If
    End Sub

    Protected Sub btnInsert_Click(sender As Object, e As EventArgs) Handles btnInsert.Click
        detail2.HotelID = ddlHotel.SelectedValue.ToString
        Dim am As Integer
        ds = hotelPxy.getAmenities(CInt(detail2.HotelID))
        am = CInt(ds.Tables(0).Rows(0).Item(0).ToString)
        detail2.BedSize = txtBedSize.Text
        detail2.NightlyPrice = txtPrice.Text
        detail2.NumberOfPeople = txtNumPpl.Text
        detail2.NumberRoom = txtRoomAvail.Text
        detail2.RoomType = CStr(am)
        hotelPxy.insertRoom(detail2, detail2.HotelID, am)


    End Sub
End Class